var express = require('express');
var cookieParser = require('cookie-parser');
var app = express();
app.use(cookieParser());

app.use(function (req, resp, next) {
    console.log(req.cookies);
    next('route');
});

app.all('*', function (req, resp) {
    resp.end('dd');
});

// development error handler will print stacktrace
if (app.get('env') === 'development') {
    app.use(function (err, req, res, next) {
        console.log("error:" + err);
        res.end('error');
    });
}

app.listen(3000, function () {
    console.log('ok');
});
